package chwgigs.swing.outline;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;

import ch.randelshofer.quaqua.QuaquaManager;

public class J03_HelloSwingComponent extends JFrame {

	private JPanel contentPane;
	private JTextField textField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		System.setProperty("Quaqua.tabLayoutPolicy", "wrap");
				
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UIManager.setLookAndFeel(
							QuaquaManager.getLookAndFeel());
					
					J03_HelloSwingComponent frame = new J03_HelloSwingComponent();
					
					//UIManager.setLookAndFeel(
					//		"javax.swing.plaf.metal.MetalLookAndFeel");
					
					
					// Look And Feel 지정
					
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public J03_HelloSwingComponent() {
		setTitle("Hello~!");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JLabel lblHelloSwing = new JLabel("Hello, Swing!! 안녕하세요~ 스윙~~!!");
		lblHelloSwing.setHorizontalAlignment(SwingConstants.CENTER);
		contentPane.add(lblHelloSwing, BorderLayout.NORTH);
		
		textField = new JTextField();
		contentPane.add(textField, BorderLayout.WEST);
		textField.setColumns(10);
		
		JCheckBox chckbxNewCheckBox = new JCheckBox("독서");
		contentPane.add(chckbxNewCheckBox, BorderLayout.EAST);
		
		JButton button = new JButton("확인");
		contentPane.add(button, BorderLayout.SOUTH);
		
		JEditorPane editorPane = new JEditorPane();
		contentPane.add(editorPane, BorderLayout.CENTER);
	}

}
